package com.wc.alorithm_blue_bridge._简单题.Q3238;

import java.util.Scanner;

/**
 * @Author congge
 * @Date 2023/11/22 11:45
 * @description 小蓝和小桥的挑战
 * https://www.lanqiao.cn/problems/3238/learning/?page=1&first_category_id=1
 */
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int t = sc.nextInt();
        while (t-- > 0) {
            int n = sc.nextInt();
            int ans = 0;
            while (n-- > 0) {
                int num = sc.nextInt();
                if (num == 0) {
                    ans++;
                }
            }
            System.out.println(ans);
        }
    }
}
